
<script src="__TMPL__/public/assets/js/jquery-1.10.2.min.js"></script>
<script src="__TMPL__/public/assets/layui/layui.js"></script>
<script src="__STATIC__/js/laydate.js"></script>
<link  href="__TMPL__/public/assets/layui/css/layui.css" rel="stylesheet">
<script src="__STATIC__/js/echarts.min.js"></script>
<script>
    layui.use('laydate', function(){
        var laydate = layui.laydate;
        //执行一个laydate实例
        laydate.render({
            elem: '#test5' //指定元素
        });
        laydate.render({
            elem: '#test3' //指定元素
        });
    });
</script>

<style>
    .help-block{
        font-size: 12px !important;color: #777777;
    }
</style>

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md8">


            <form class="layui-form" action=""  lay-filter="example" style="padding-top: 20px" >


                <div class="layui-form-item">
                    <label class="layui-form-label">标题</label>
                    <div class="layui-input-block">
                        <input type="text" value="{$info.title}" name="title"  class="layui-input">
                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">排序</label>
                    <div class="layui-input-block">
                        <input type="text"  value="{$info.order}" name="order"  class="layui-input">
                    </div>
                </div>



                <div class="layui-form-item">
                    <label class="layui-form-label">截至时间</label>
                    <div class="layui-input-block">
                        <input type="text" class="layui-input" value="{$info.endtime | date='Y-m-d H:i'}" name="endtime"  id="test5" >
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">产品类型</label>
                    <div class="layui-input-block">

                        <select name="types" lay-filter="types">
                            <option value="1" <if condition="$info['types']==1">selected </if> >酒类</option>
                            <option value="2" <if condition="$info['types']==2">selected </if> >手机</option>
                            <option value="3" <if condition="$info['types']==3">selected </if> >其他</option>
                        </select>

                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">状态</label>
                    <div class="layui-input-block">

                        <select name="status" lay-filter="types">

                            <option value="1" <if condition="$info['status']==1">selected </if> >报单中</option>
                            <option value="2" <if condition="$info['status']==2">selected </if> >已完成</option>
                            <option value="3" <if condition="$info['status']==3">selected </if>>已取货</option>
                            <option value="4" <if condition="$info['status']==4">selected </if>>已结款</option>
                            <option value="5" <if condition="$info['status']==5">selected </if>>已核查</option>

                        </select>

                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">型号</label>
                    <div class="layui-input-block">
                        <textarea type="text" style="height: 40px" class="layui-input"  name="desc" >{$info.desc}</textarea>
                        <p>多个请用 , 分开</p>
                    </div>
                </div>



                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button type="button"  class="layui-btn" id="LAY-component-form-getval" lay-submit="" lay-filter="demo1">立即提交</button>

                    </div>
                </div>
            </form>

            <script>
                layui.use(['form', 'util', 'laydate'], function() {
                    var form = layui.form;
                    var layer = layui.layer;
                    var util = layui.util;
                    var laydate = layui.laydate;

                    //表单取值
                    layui.$('#LAY-component-form-getval').on('click', function () {
                        var data = form.val('example');

                        // var data=JSON.stringify(data);

                        console.log(data);

                        $.ajax({
                            url: '',
                            data: data,
                            type:'post',
                            success:function (res){
                                layer.msg(res.msg);

                                if (res.code==1){
                                    location.reload();
                                }


                            }
                        })




                    });
                })

            </script>



        </div>
    </div>
</div>